Skip to content

Document referrerPolicy for <script> - #8771

Open
ZainnQureshii wants to merge 1 commit into
reactjs:mainfrom
ZainnQureshii:docs/script-referrer-policy
Open

ZainnQureshii wants to merge 1 commit into
reactjs:mainfrom
ZainnQureshii:docs/script-referrer-policy

Conversation

@ZainnQureshii

Copy link
Copy Markdown

At src/content/reference/react-dom/components/script.md:49, the <script> reference listed referrer. Adding referrer="no-referrer" to the external-script example emits an attribute the browser ignores when choosing a referrer policy. With the default policy, a same-origin script request can still send the page URL in Referer. The entry now documents referrerPolicy for fetching the script and its imported modules. HTML Standard · Referrer Policy

The note at src/content/reference/react-dom/components/script.md:111 suggested calling preinit to fetch a script earlier. The new qualification at line 113 tells readers who need a specific policy to skip preinit for the same URL. In React 19.0.0 server rendering, an async script with referrerPolicy="no-referrer" emitted that attribute. Calling preinit first emitted a script for the same URL without the policy.

Local checks passed with Node 24.21.0 and the locked dependencies.

  • yarn check-all
  • yarn eslint src/content/reference/react-dom/components/script.md
  • yarn prettier:diff for source files. The repository excludes content Markdown from Prettier.
  • yarn test:eslint-local-rules
  • yarn lint-heading-ids

Prepared with AI assistance (Codex and Claude Code) and reviewed with GitHub Copilot.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

This branch was successfully deployed

1 active deployment
Preview — 95b47fee Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant